From da538487143fc14cfabf08c5b464ccc6ab8816c8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 3 Mar 2006 10:56:13 +0100 Subject: [PATCH] Raises an explicit error message when the domain config file specifies an incorrect path to a file-backed VBD (disk image) or the file-backed VBD does not exist. Without this patch, if someone mis-types the path to the disk image, he/she would have no indication as to what's wrong when the domain fails to get created. Signed-off-by: Khoa Huynh --- tools/python/xen/xend/image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 4d58c25d9a..f9b061a4ec 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -274,6 +274,10 @@ class HVMImageHandler(ImageHandler): uname = sxp.child_value(info, 'uname') typedev = sxp.child_value(info, 'dev') (_, vbdparam) = string.split(uname, ':', 1) + + if 'file:' in uname and not os.path.isfile(vbdparam): + raise VmError('Disk image does not exist: %s' % vbdparam) + if 'ioemu:' in typedev: (emtype, vbddev) = string.split(typedev, ':', 1) else: -- 2.30.2